home *** CD-ROM | disk | FTP | other *** search
/ QuickTime 2.0 Developer Kit / QuickTime 2.0 Developer Kit.iso / mac / MAC / Programming Stuff / Sample Code / Image Compression Mgr / Inside Mac ICM Code / icm2.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-12-04  |  1.2 KB  |  58 lines  |  [TEXT/MPS ]

  1. /*
  2.   File:            icm2.c
  3.   Contains:        Main Function
  4.   Written by:    DTS and QT Engineering
  5.   Copyright:    © 1992-1994 by Apple Computer, Inc., all rights reserved.
  6.   Change History (most recent first):
  7.   <1>         12/4/94    khs        changed the format of the file to the new look and feel
  8.   To Do:
  9. */
  10.  
  11.  
  12. // INCLUDE FILES
  13. #include "icm.h"
  14.  
  15.  
  16. // MAIN FUNCTION
  17. void main(void)
  18. {
  19.     WindowPtr displayWindow;
  20.     Rect windowRect;
  21.     PicHandle pic;
  22.     long stupid;
  23.  
  24.     InitGraf(&qd.thePort);
  25.     InitFonts();
  26.     InitWindows();
  27.     InitMenus();
  28.     TEInit();
  29.     InitDialogs(nil);
  30.     MaxApplZone();
  31.  
  32.     SetRect(&windowRect, 0, 0, 256, 256);
  33.     OffsetRect(&windowRect,                        // middle of screen
  34.                ((qd.screenBits.bounds.right - qd.screenBits.bounds.left) - windowRect.right) / 2, 
  35.                 ((qd.screenBits.bounds.bottom - qd.screenBits.bounds.top) - windowRect.bottom) / 2);
  36.     displayWindow = NewCWindow(nil, &windowRect, "\pImage", true, 0, (WindowPtr) - 1, true, 0);
  37.     if (displayWindow)
  38.     {
  39.         SetPort(displayWindow);
  40.         SequenceSave();
  41.         SequencePlay();
  42.     }
  43.     pic = GetQTCompressedPict((CGrafPtr)displayWindow);
  44.  
  45.     EraseRect(&((CGrafPtr)displayWindow)->portRect);
  46.  
  47.     Delay(30, &stupid);
  48.     if (pic)
  49.         DrawPicture(pic, &((CGrafPtr)displayWindow)->portRect);
  50.     else
  51.         DebugStr("\pGetQTCompressedPict failed");
  52.     while (!Button())
  53.         ;
  54.  
  55. }
  56.  
  57.  
  58.